package org.come.mouslisten;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import org.come.Frame.ZhuFrame;
import org.come.Jpanel.PetEquipmentJpanel;
import org.come.Jpanel.PetsMsgJpanel;
import org.come.entity.Goodstable;
import org.come.entity.RoleSummoning;
import org.come.until.GoodsListFromServerUntil;
import org.come.until.UserMessUntil;
import org.come.until.Util;
import org.lottery.panel.LotteryIntegralGoodsJpanel;

public class PetEquipMouslisten implements MouseListener {

    private PetEquipmentJpanel jpanel;
    private PetsMsgJpanel jpanel1;
    private LotteryIntegralGoodsJpanel jpanel2;
    private int type;

    private Goodstable goodstable;

    public PetEquipMouslisten(PetEquipmentJpanel jpanel, int type) {
        super();
        this.jpanel = jpanel;
        this.type = type;
    }

    public PetEquipMouslisten(PetsMsgJpanel jpanel1, int type) {
        super();
        this.jpanel1 = jpanel1;
        this.type = type;
    }

    public PetEquipMouslisten(LotteryIntegralGoodsJpanel jpanel2) {
        super();
        this.jpanel2 = jpanel2;
        this.type = type;
    }

    public PetEquipMouslisten(PetsMsgJpanel jpanel1, int type, Goodstable goodstable) {
        super();
        this.jpanel1 = jpanel1;
        this.type = type;
        this.goodstable = goodstable;
    }


    @Override
    public void mouseClicked(MouseEvent e) {
        RoleSummoning pet = UserMessUntil.getChosePetMes();
        if (pet != null) {
            /** 判断是否解锁 */
            if (Util.isCanBuyOrno() ) {
                return;
            }
            jpanel.Equip(pet, null, type);

        }
    }

    @Override
    public void mousePressed(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseReleased(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseEntered(MouseEvent e) {
        // TODO Auto-generated method stub
//        Goodstable goodstable = GoodsListFromServerUntil.fushis.get(UserMessUntil.getChosePetMes().getGoodId(type));
        if (this.goodstable != null) {
            ZhuFrame.getZhuJpanel().creatgoodtext(this.goodstable);
        }

    }

    @Override
    public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub
        ZhuFrame.getZhuJpanel().cleargoodtext();
    }

}
